package com.java.day01;

public class BothRunnableThread extends  Thread{
    public BothRunnableThread(Runnable runnable) {
    }

    @Override
    public void run() {
        System.out.println("my thread run");
    }

    public static void main(String[] args) {
        new Thread(new Runnable() {
            public void run() {
                System.out.println("runnable thread");
            }
        }
        ){
            @Override
            public void run() {
                System.out.println("thread thread");
            }
        }.start();

        Thread thread = new BothRunnableThread(new Runnable() {
            public void run() {
                System.out.println("runnable");
            }
        });

        thread.start();
    }
}
